#!/usr/bin/env python
#
'''
Created on 2009-3-15

@author: Wang_Yuan
'''

import datetime

def mustExam(wordData):
    if not (wordData.hasExamples() or wordData.hasEnglishMeanings() or wordData.hasNonEnglishMeanings):
        return False 
    records = wordData.records
    passScore = 7
    if not records:
        return True
    if records[0].score < passScore:
        return True
    if sum(map(lambda r: r.score, records[:3])) < passScore * 3:
        return True
    now = datetime.datetime.now()
    dday = records[0].date - now
    if dday.days > 2 ** (len(records)>>1):
        return True
